]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Use dedicated resources for helper programs
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 10 Aug 2018 11:56:07 +0000 (13:56 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Tue, 14 Aug 2018 17:28:04 +0000 (17:28 +0000)
Using a single resource file for all JS sources saves a couple of
build system instructions, but has some serious downsides:

 - bundling the entire shell code with the tools blows
   up their size unnecessarily

 - the tools are rebuilt unnecessarily for any shell
   code change

Autotools was painful enough to let this slip, but with meson we
don't have any excuses - using the actual dependencies speeds up
the build a tiny bit and reduces the tools' sizes from over 2M
to about 50k.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/192

js/js-resources.gresource.xml
js/meson.build
js/portal-resources.gresource.xml [new file with mode: 0644]
js/prefs-resources.gresource.xml [new file with mode: 0644]
src/meson.build

index 3c0feab60851927eecc0fbc523b7a13dd2ebc026..75a6c3b124ef23eafa897281ce392c604874e771 100644 (file)
@@ -9,8 +9,6 @@
     <file>gdm/realmd.js</file>
     <file>gdm/util.js</file>
 
-    <file>extensionPrefs/main.js</file>
-
     <file>misc/config.js</file>
     <file>misc/extensionUtils.js</file>
     <file>misc/fileUtils.js</file>
@@ -33,8 +31,6 @@
     <file>perf/core.js</file>
     <file>perf/hwtest.js</file>
 
-    <file>portalHelper/main.js</file>
-
     <file>ui/accessDialog.js</file>
     <file>ui/altTab.js</file>
     <file>ui/animation.js</file>
index dd8ca3f66e6fabdd29465367c6c58d6f9990bfc3..4a572c53ffc80a746c865a88431cb498abf61149 100644 (file)
@@ -6,3 +6,17 @@ js_resources = gnome.compile_resources(
   c_name: 'shell_js_resources',
   dependencies: [config_js]
 )
+
+portal_resources = gnome.compile_resources(
+  'portal-resources', 'portal-resources.gresource.xml',
+  source_dir: ['.', meson.current_build_dir()],
+  c_name: 'portal_js_resources',
+  dependencies: [config_js]
+)
+
+prefs_resources = gnome.compile_resources(
+  'prefs-resources', 'prefs-resources.gresource.xml',
+  source_dir: ['.', meson.current_build_dir()],
+  c_name: 'prefs_js_resources',
+  dependencies: [config_js]
+)
diff --git a/js/portal-resources.gresource.xml b/js/portal-resources.gresource.xml
new file mode 100644 (file)
index 0000000..3a06747
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/shell">
+    <file>misc/config.js</file>
+    <file>portalHelper/main.js</file>
+  </gresource>
+</gresources>
diff --git a/js/prefs-resources.gresource.xml b/js/prefs-resources.gresource.xml
new file mode 100644 (file)
index 0000000..653c4cb
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/shell">
+    <file>extensionPrefs/main.js</file>
+
+    <file>misc/config.js</file>
+    <file>misc/extensionUtils.js</file>
+    <file>misc/fileUtils.js</file>
+    <file>misc/params.js</file>
+  </gresource>
+</gresources>
index 8cd7fe8cf9ef2ab8827543bc397d52543e1f688f..178e058994456fe424cf17049b13c83a82cf99ee 100644 (file)
@@ -261,7 +261,7 @@ executable('gnome-shell', 'main.c',
 )
 
 executable('gnome-shell-extension-prefs',
-  'gnome-shell-extension-prefs.c', js_resources,
+  'gnome-shell-extension-prefs.c', prefs_resources,
   c_args: tools_cflags,
   dependencies: tools_deps,
   include_directories: [conf_inc],
@@ -271,7 +271,7 @@ executable('gnome-shell-extension-prefs',
 
 if have_networkmanager
   executable('gnome-shell-portal-helper',
-    'gnome-shell-portal-helper.c', js_resources,
+    'gnome-shell-portal-helper.c', portal_resources,
     c_args: tools_cflags,
     dependencies: tools_deps,
     include_directories: [conf_inc],